<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>导航条练习</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }
        ul li {
            list-style: none;
        }
        .nav {
            width: 1202px;
            height: 48px;
            background-color: #e7e7e2;
            margin: 100px auto;
        }
        .nav li {
            float: left;
            /*!*height: 100%;*! 有了line-height后可以不用设置height*/
            line-height: 48px;
        }

        .nav a {
            /*将a转换成块状元素，目的是将a的行高与li的行高一致，鼠标可以在文本的上下点击*/
            display: block;
            text-decoration: none;
            color: #777;
            font-size: 18px;

            padding: 0px 39px;
        }

        .nav a:hover {
            background-color: #3F3F3F;
            color: #E8E7E3;
        }
    </style>
</head>
<body>
    <ul class="nav">
        <li>
            <a href="#">HTML/CSS</a>
        </li>
        <li>
            <a href="#">Browser Side</a>
        </li>
        <li>
            <a href="#">server Side</a>
        </li>
        <li>
            <a href="#">Programming</a>
        </li>
        <li>
            <a href="#">XML</a>
        </li>
        <li>
            <a href="#">Web Building</a>
        </li>
        <li>
            <a href="#">Reference</a>
        </li>
    </ul>
</body>
</html>